using System.Net;
using Microsoft.WindowsAzure;

namespace AzureContrib.WindowsAzure.StorageClient
{
	internal class StorageCredentialsWrapper : IStorageCredentials
	{
		private readonly StorageCredentials storageCredentials;

		public StorageCredentialsWrapper(StorageCredentials storageCredentials)
		{
			this.storageCredentials = storageCredentials;
		}

		public string AccountName
		{
			get { return storageCredentials.AccountName; }
		}

		public bool NeedsTransformUri
		{
			get { return storageCredentials.NeedsTransformUri; }
		}

		public bool CanSignRequest
		{
			get { return storageCredentials.CanSignRequest; }
		}

		public bool CanSignRequestLite
		{
			get { return storageCredentials.CanSignRequestLite; }
		}

		public bool CanComputeHmac
		{
			get { return storageCredentials.CanComputeHmac; }
		}

		public string TransformUri(string resourceUri)
		{
			return storageCredentials.TransformUri(resourceUri);
		}

		public void SignRequest(HttpWebRequest request)
		{
			storageCredentials.SignRequest(request);
		}

		public void SignRequestLite(HttpWebRequest request)
		{
			storageCredentials.SignRequestLite(request);
		}

		public string ComputeHmac(string value)
		{
			return storageCredentials.ComputeHmac(value);
		}

		public StorageCredentials WrappedCredentials
		{
			get { return storageCredentials; }
		}
	}
}